<?php
declare (strict_types=1);

namespace app\admin\model\Live;

use app\common\model\TimeModel;
use phpseclib3\Common\Functions\Strings;


/**
 * @mixin \think\Model
 */
class LiveUserLog extends TimeModel
{
    protected $name = "live_user_log";

    protected $deleteTime = "delete_time";

    /**
     * 获取用户 禁止发言时间
     * Author:William
     * @param int $id
     * @return array|\think\Model|string 时间戳
     */
    public function getUserNoSpeakTime($userId)
    {
        $field = [
            'no_speaking_time'
        ];
        $data = self::where('user_id', $userId)->order('id','desc')->field($field)->find();
        $data && $data = $data->toArray();
        return $data;
    }
}
